<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>文章列表</title>
    <link rel="stylesheet" href="/assets/css/base.css" />
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css" />
  </head>
  <body>
    <div class="layui-card">
      <div class="layui-card-header">文章列表</div>
      <div class="layui-card-body">
        <form class="layui-form">
          <div class="layui-form-item">
            <div class="layui-inline">
              <div class="layui-input-inline" style="width: 200px">
                <select name="category" lay-verify="required">
                  <option value="">所有分类</option>
                  <!-- <option value="0">北京</option>
                  <option value="1">上海</option>
                  <option value="2">广州</option>
                  <option value="3">深圳</option>
                  <option value="4">杭州</option> -->
                </select>
              </div>
              <div class="layui-input-inline" style="width: 200px">
                <select name="state" lay-verify="required">
                  <option value="">所有状态</option>
                  <option value="小">已发布</option>
                  <option value="犊子">草稿</option>
                  <!-- <option value="0">北京</option>
                  <option value="1">上海</option>
                  <option value="2">广州</option>
                  <option value="3">深圳</option>
                  <option value="4">杭州</option> -->
                </select>
              </div>
            </div>

            <div class="layui-inline">
              <div class="layui-input-inline" style="width: 100px">
                <button type="button" class="layui-btn" id="search">
                  筛选
                </button>
              </div>
            </div>
          </div>
        </form>
        <table class="layui-table">
          <colgroup>
            <col width="40%" />
            <col width="15%" />
            <col width="16%" />
            <col width="15%" />
            <col />
          </colgroup>
          <thead>
            <tr>
              <th>文章标题</th>
              <th>分类</th>
              <th>发表时间</th>
              <th>状态</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <!-- <tr>
              <td>李鹏征婚启事</td>
              <td>科学</td>
              <td>2020-11-01 17-21-09</td>
              <td>已发布</td>
              <td>
                <button type="button" class="layui-btn layui-btn-xs">
                  编辑
                </button>
                <button
                  type="button"
                  class="layui-btn layui-btn-danger layui-btn-xs"
                >
                  删除
                </button>
              </td>
            </tr>
            <tr>
              <td>李鹏征婚启事</td>
              <td>sd</td>
              <td>2020-11-01 17-21-09</td>
              <td>已发布</td>
              <td>
                <button type="button" class="layui-btn layui-btn-xs">
                  编辑
                </button>
                <button
                  type="button"
                  class="layui-btn layui-btn-danger layui-btn-xs"
                >
                  删除
                </button>
              </td>
            </tr> -->
          </tbody>
        </table>
        <div id="page"></div>
      </div>
    </div>

    <script type="text/html" id="tpl-list">
      {{each data item}}
      <tr>
        <td>{{item.title}}</td>
        <td>{{item.cate_name}}</td>
        <td>{{item.pub_data}}</td>
        <td>{{item.state}}</td>
        <td>
          <a
            href="/article/edit.html?id={{item.Id}}"
            type="button"
            class="layui-btn layui-btn-xs"
            >编辑</a
          >
          <button
            id="goodbye"
            type="button"
            class="layui-btn layui-btn-danger layui-btn-xs"
          >
            删除
          </button>
        </td>
      </tr>
      {{/each}}
    </script>

    <script type="text/html" id="tpl-category">
      {{each data}}
      <option value="{{$value.Id}}">{{$value.name}}</option>
      {{/each}}
    </script>

    <script src="/assets/lib/jquery.js"></script>
    <script src="/assets/lib/layui/layui.all.js"></script>
    <script src="/assets/lib/template-web.js"></script>
    <script src="/assets/js/common.js"></script>
    <script src="/assets/js/article.js"></script>
  </body>
</html>
